<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui"
    />
    <link type="text/css" rel="stylesheet" href="http://api.geekfootball.com/app/css/animate.min.css">
    <link type="text/css" rel="stylesheet" href="http://api.geekfootball.com/app/css/article.min.css">
    <script type="text/javascript" src="http://api.geekfootball.com/app/js/article.all.min.js"></script>
    <title>${post.title}</title>
</head>

<body>
    <header>
        <h1>${post.title}</h1>
        <h2>
            <time>${post.time}</time>
        </h2>
    </header>
    <article>
        <div class="con">
            ${post.body}
        </div>

        <div>
            来源: ${post.source}
        </div>
    </article>
    <script type="text/javascript">

        function connectWebViewJavascriptBridge(callback) {
            if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
            if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
            window.WVJBCallbacks = [callback];
            var WVJBIframe = document.createElement('iframe');
            WVJBIframe.style.display = 'none';
            WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';
            document.documentElement.appendChild(WVJBIframe);
            setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
        }

        connectWebViewJavascriptBridge(function (bridge) {
            // Video
            bridge.callHandler('hideLoading');
            setVideos(bridge);

//            Image Galleries
//            var images = getImages();
//            bridge.callHandler('setGalleries', {'images': JSON.stringify(images)});
            setImgMode(imgMode, bridge);
        });


        var imgMode = getShareParameter('_img');

        function click(url) {
            var js = document.createElement('script');
            js.id = 'visits_script';
            js.setAttribute('charset','utf-8');
            js.src = url;
            document.body.appendChild(js);
        }

        $('#reload').on('click', function(e){
            reloadVideos();
        });
        function reloadVideos(){
            $('iframe').each( function(index, item) {
                $(item).attr('src', $(item).attr('src'));
            });
        }

    </script>
</body>